import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '@/layout/Home.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'), meta: { title: '登录页面' },
  },
  {
    path: '/home',
    component: Home,
    meta: { title: '系统首页' },
    redirect: '/index',
    children: [
      { path: '/index', component: () => import('@/views/index/index.vue'), meta: { title: '首页展示' }},
      { path: '/formDesign', component: () => import('@/views/from/Print/index.vue'), meta: { title: '表单设计' }},
      { path: '/designTemplate', component: () => import('@/views/from/designTemplate/index.vue'), meta: { title: '设计模板' }},
      { path: '/task', component: () => import('@/views/user/task/index.vue'), meta: { title: '我的任务' }},
      { path: '/application', component: () => import('@/views/user/application/index.vue'), meta: { title: '流程申请' }},
      { path: '/attendance', component: () => import('@/views/user/attendance/index.vue'), meta: { title: '考勤打卡' }},
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
